﻿Chenxin.UI.PrintInvoiceForm = Chenxin.extend(Chenxin.UI.FormCommon, {
    actionUrl: '/service/logic/ShowListBill.ashx',
    id: 'frm_printinvoice',
    jqmWidth: 800,
    jqmHeight: 425,
    title: '打印发票',
    type: 'jqmodel',
    defBBtn: false,
    op: 'printinvoice',
    jqmHasFoot: true,
    createBBtn: function() {
        return [
        {
            text: '页面设置',
            handler: this.settingPring
        }, {
            text: '打印',
            handler: this.printForm
        }, {
            text: '关闭',
            handler: this.hide,
            scope: this
}]
        },
        fitData: function(model) {
            $("#invoiceshow").empty();
            $("#invoiceshow").append(model);
        },
        createForm: function() {
            return Chenxin.FormCommon.InvoiceForm(this.id);
        },
        settingPring: function() {
            document.all.WebBrowser.ExecWB(8, 1);
        },
        printForm: function() {
            var prtContent = $("#invoiceshow").html();
            var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0,menubar=0');
            WinPrint.document.write(prtContent);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
        },
        reset: function() {
            this.fitData({});
        },
        initComponent: function() {
            Chenxin.UI.PrintInvoiceForm.superclass.initComponent.call(this);
        }
    });

Chenxin.FormCommon.InvoiceForm = function(formId) {// height:100px;overflow:auto;
    return '<div id="invoiceshow"></div>';
}

